package com.gzhryc.shared_device.pcl.code.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.common.device.dao.db.Device;
import com.gzhryc.shared_device.pcl.code.dao.enums.ChargingCableEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * 充电线对象
 */
@Table(name="dev_charging_cable")
public class ChargingCable implements Serializable {

    private static final long serialVersionUID = 1L;

	@Id(auto = false)
    @Column(name = "device_sn")
    protected String deviceSn;

    @Column(name = "device_type_id")
    protected String deviceTypeId;

    @Column(name="device_type_name",note = "设备类型名称")
    protected String deviceTypeName;

    @Column(name = "protocol_type", length = 16, notNull = true, note = "协议类型")
    protected String protocolType;

    @Column(name="secret_key",notNull = true,note = "密钥")
    protected String secretKey;

    @Column(name="pwd_index",notNull = true,note = "密码序列")
    protected String pwdIndex;

    @Column(notNull = true, defVal = "1", note = "设备状态")
    protected Integer state;

    @Column(length = 64,note = "备注")
    protected String note;

    @Column(name = "current_trade_no",note = "当前订单号")
    protected String currentTradeNo;

    @Column(name = "last_work_date")
    protected Date lastWorkDate;

    @Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @Join(fromField = "device_sn",toField = "device_sn")
    protected Device device;

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public String getDeviceTypeId() {
        return deviceTypeId;
    }

    public void setDeviceTypeId(String deviceTypeId) {
        this.deviceTypeId = deviceTypeId;
    }

    public String getDeviceTypeName() {
        return deviceTypeName;
    }

    public void setDeviceTypeName(String deviceTypeName) {
        this.deviceTypeName = deviceTypeName;
    }

    public String getProtocolType() {
        return protocolType;
    }

    public void setProtocolType(String protocolType) {
        this.protocolType = protocolType;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getPwdIndex() {
        return pwdIndex;
    }

    public void setPwdIndex(String pwdIndex) {
        this.pwdIndex = pwdIndex;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getCurrentTradeNo() {
        return currentTradeNo;
    }

    public void setCurrentTradeNo(String currentTradeNo) {
        this.currentTradeNo = currentTradeNo;
    }

    public Date getLastWorkDate() {
        return lastWorkDate;
    }

    public void setLastWorkDate(Date lastWorkDate) {
        this.lastWorkDate = lastWorkDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Device getDevice() {
        return device;
    }

    public void setDevice(Device device) {
        this.device = device;
    }

    public String getStateName(){
        return ChargingCableEnum.State.note(this.state);
    }
}
